#include "logger.h"
#include <QDebug>

QTextStream* Logger::_logStream = NULL;
QFile* Logger::_file = NULL;

Logger::Logger(QObject *parent) :
    QObject(parent)
{
}

QTextStream& Logger::log()
{
    if(_logStream==NULL)
    {
        _file = new QFile("log.log");
        if(_file->open(QIODevice::Append))
        {
            _logStream = new QTextStream(_file);
        }
    }
    *_logStream<<endl;
    _logStream->flush();
    return *_logStream;
}
